import React, { Component } from 'react';
import axios from 'axios';
import  './App.css';

class App extends Component {
    getStudents=()=>{
        axios.get('http://localhost:3000/api1/students').then(
            response=>{console.log('成功了',response)},
            error=>{console.log('失败了',error)}
        )
    }
   
    render() {
        return (   
                <div>
                    <button onClick={this.getStudents}>点我获取学生信息</button>
                </div>
        );
    }
}

export default App;